/********************************************************************
	TABAL ENGINE - 2012/11/08
	author:		Marc Cuscullola
	
	purpose:	Defines a generic camera
*********************************************************************/
#pragma once

#ifndef __CAMERA__INCLUDED_H__
#define __CAMERA__INCLUDED_H__

#include "Vector/Vector3.h"
#include "Matrix\Matrix44.h"

class CObject3D;

class CCamera
{
public:
	CCamera(float _fZNear, float _fZFar, float _fFOV, float _fAspectRatio, CObject3D* _pObject);
	CCamera();
	virtual ~CCamera();

	void					UpdateMatrices	();

	// Get Methods
	virtual Vect3f			GetDirection	() const = 0;
	virtual Vect3f			GetLookAt		() const = 0;
	virtual Vect3f			GetEye			() const = 0;
	virtual Vect3f			GetVecUp		() const = 0;

	inline float			GetZNear		() const;
	inline float			GetZFar			() const;
	inline float			GetAspectRatio	() const;
	inline float			GetFOV			() const;
	inline CObject3D*		GetObject		() const;

	inline const Mat44f&	GetViewMatrix	() const;
	inline const Mat44f&	GetProjMatrix	() const;

	// Set Methods
	inline void				SetZNear		(float _fZNear);
	inline void				SetZFar			(float _fZFar);
	inline void				SetObject		(CObject3D* _pObject);

	// Add Methods
	inline void				AddZNear		(float _fAmount);
	inline void				AddZFar			(float _fAmount);
	inline void				AddFOV			(float _fAmount);

private:
	void	CreateViewMatrix		();
	void	CreateProjectionMatrix	();

protected:
	CObject3D*		m_pObject3D;
	float			m_fFOV;
	float			m_fAspectRatio;
	float			m_fZNear;						
	float			m_fZFar;

	Mat44f			m_ViewMatrix;
	Mat44f			m_ProjectionMatrix;
};

#include "Camera.inl"

#endif //__CAMERA__INCLUDED_H__